Python

Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default

Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default, someone asked me to explain?

I got this following error while running the command " python manage.py migrate"  

"Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default"

SOLUTION:

STEP 1:

Go to admin project's URL.py and comment the line "admin.site.urls" in  urlpatterns. 

from django.contrib import admin
from django.urls import include, path, re_path as url
urlpatterns = [
    #path('admin/', admin.site.urls),
    path('', include(('myaccount.urls', 'myaccount'), namespace='myaccount')),
    url(r'cricket/', include(('cricket.urls', 'cricket'), namespace='cricket')),
]

STEP 2:

And then go to settings.py and comment the "django.contrib.admin" in INSTALLED_APPS.

INSTALLED_APPS = [
    #'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'myaccount',    
]

Now run the command python manage.py migrate. It will run the migration successful.

Finally un comment it.

VIDEO GUIDE:

Post your comments / questions